package com.gzedu.common.sys;

import javax.servlet.http.HttpServletRequest;

import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO;
import org.apache.shiro.session.mgt.eis.SessionDAO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CacheSessionDAO extends EnterpriseCacheSessionDAO implements SessionDAO{
	private Logger logger = LoggerFactory.getLogger(getClass());
	
	public CacheSessionDAO() {
        super();
    }
	
	@Override

    protected void doUpdate(Session session) {

	     if (session == null || session.getId() == null) {  
	         return;
	     }

     	HttpServletRequest request = Servlets.getRequest();

		if (request != null){
		
			String uri = request.getServletPath();
			
			// 如果是静态文件，则不更新SESSION
			
			if (Servlets.isStaticFile(uri)){
				return;
			}
		}

	}
}
